<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>demo</title>
  <script type="text/javascript" src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- 使用组件 -->
    <Count/>
    <Count/>
    <Count/>
    <Count/>
    <Count/>
  </div>
</body>
<script type="text/javascript">
  Vue.config.productionTip = false;

  //创建组件
  /* 
  
  */
  let Count = {
    name: "Count",
    data() {
      return {
        a: 1
      }
    },
    template: `<span>第一个组件</span>`
  }

  console.log(Count, "组件");
  
  let Dd = {
    name: "Dd",
    data() {
      return {
        Dd: 0
      }
    },
    template: `<span>第二个组件</span>`
  }

  const vm = new Vue({
    el: "#app",
    data() {
      return {}
    },
    //注册组件
    components: {
      Count,
      Dd
    },
    template: `
    <div>
      <Count />
      <Dd></Dd>>
    </div>
    `
  })
</script>

</html>